<script lang="ts" setup>
import { useLocale } from '@/locale/locale';
import CheckForAgreement from './check-for-agreement.vue';
import SwitchModeButton from './switch-mode-button.vue';

const { t } = useLocale();

const emit = defineEmits(['login', 'switch']);

function handleGetPhoneNumber(e: AnyObject) {
  emit('login', {
    code: e.code
  });
}
</script>

<template>
  <uv-button
    :custom-style="{
      width: '630rpx',
      height: '100rpx',
      backgroundColor: ' #269c74',
      color: '#fff'
    }"
    open-type="getPhoneNumber"
    shape="circle"
    @getphonenumber="handleGetPhoneNumber"
  >
    {{ t('LAKey_oneClickLogin') }}
  </uv-button>
  <SwitchModeButton :text="t('LoginUsingAnotherPhone')" @click="$emit('switch')" />
  <CheckForAgreement />
</template>
